#ifndef __OLED_H
#define __OLED_H 

#include "sys.h"
#include "stdlib.h"	
#include <rtdevice.h>
//-----------------OLED端口定义---------------- 
#define SCL_PIN    67   /*PA0*/
#define SDA_PIN    32   /*PA1*/
#define RES_PIN    23   /*PA2*/
#define DC_PIN    30    /*PA3*/
#define CS_PIN    29    /*PA4*/

#define OLED_SCL_Clr() rt_pin_write(SCL_PIN,PIN_LOW)//SCL
#define OLED_SCL_Set() rt_pin_write(SCL_PIN,PIN_HIGH)

#define OLED_SDA_Clr() rt_pin_write(SDA_PIN,PIN_LOW)//SDA
#define OLED_SDA_Set() rt_pin_write(SDA_PIN,PIN_HIGH)

#define OLED_RES_Clr() rt_pin_write(RES_PIN,PIN_LOW)//RES
#define OLED_RES_Set() rt_pin_write(RES_PIN,PIN_HIGH)

#define OLED_DC_Clr()  rt_pin_write(DC_PIN,PIN_LOW)//DC
#define OLED_DC_Set()  rt_pin_write(DC_PIN,PIN_HIGH)
 		     
#define OLED_CS_Clr()  rt_pin_write(CS_PIN,PIN_LOW)//CS
#define OLED_CS_Set()  rt_pin_write(CS_PIN,PIN_HIGH)


#define OLED_CMD  0	//写命令
#define OLED_DATA 1	//写数据


void OLED_ClearPoint(u8 x,u8 y);
void OLED_ColorTurn(u8 i);
void OLED_DisplayTurn(u8 i);
void OLED_WR_Byte(u8 dat,u8 mode);
void OLED_DisPlay_On(void);
void OLED_DisPlay_Off(void);
void OLED_Refresh(void);
void OLED_Clear(void);
void OLED_DrawPoint(u8 x,u8 y,u8 t);
void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2,u8 mode);
void OLED_DrawCircle(u8 x,u8 y,u8 r);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1,u8 mode);
void OLED_ShowChar6x8(u8 x,u8 y,u8 chr,u8 mode);
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 size1,u8 mode);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode);
void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1,u8 mode);
void OLED_ScrollDisplay(u8 num,u8 space,u8 mode);
void OLED_ShowPicture(u8 x,u8 y,u8 sizex,u8 sizey,u8 BMP[],u8 mode);
void OLED_Init(void);

#endif


